<?php
/**
 * RedCross Application
 *
 */

/**
 * Course Service class for communication between controllers and persistent storage
 */
class Core_Service_MemberAccess extends RedCross_Service_ServiceAbstract
{
        private $_memberService;

    /**
     * Constructor
     * @param Core_Gateway_User $gateway
     */
    public function __construct(Core_Gateway_MemberAccess $gateway)
    {
        parent::__construct($gateway, 'Core_Model_MemberAccess');
    }

    public function removeAccess($memberId, $accessId) {
        $accessId = (int)$accessId;
        return $this->getGateway()->revoke($memberId, $accessId);
    }
    public function updateRecord($memberId, $accessId){
        $accessId = (int)$accessId;
        return $this->getGateway()->updateRecord($memberId, $accessId);
    }
    public function checkIfExists($memberId, $accessId) {
        return sizeof($this->getGateway()->checkIfExists($memberId, $accessId)) > 0;
    }
}
